<?php

namespace app\admin\controller;

use think\Cache;
use think\Controller;
use think\Request;
use think\Session;

class Base extends Controller
{
    public function _initialize()
    {
        $token = Request::instance()->header('token');
        $userid=Session::get('admin.id');
        $admintoken=Cache::get($userid);
        if (!$token==$admintoken){
            return json(msg(0,'','非法请求'));
        }
    }
}
